import re

# 匹配零个或多个 *
str1 = ''
str2 = 'a'
str3 = 'aa'
str_3 = 'aa**a*'

print(re.match('a*', str1))
print(re.match('a*', str2))
print(re.match('a*', str3))
print(re.match('a*', str_3))
# <re.Match object; span=(0, 0), match=''>
# <re.Match object; span=(0, 1), match='a'>
# <re.Match object; span=(0, 2), match='aa'>
# <re.Match object; span=(0, 2), match='aa'>

# 匹配一个或多个, 必须至少出现一个 +
str4 = ''
str5 = 'b'
str6 = 'bb'

print(re.match('b+', str4))
print(re.match('b+', str5))
print(re.match('b+', str6))
# None
# <re.Match object; span=(0, 1), match='b'>
# <re.Match object; span=(0, 2), match='bb'>